package com.samsungmobile.common.util;

import java.util.Locale;

public class LocaleUtils {

	private LocaleUtils() {};
	
	/**
	 * Return the Locale for the given lang parameter
	 * (gbr, ger, ita,...)
	 * @param lang 
	 * @return
	 */
	public static Locale getLocaleByLang(String lang){
		if(lang == null || lang.equals("")){
			return null;
		}
		else {
			lang = lang.toLowerCase();
			if(lang.equals("gbr")){
				return Locale.UK;
			} else if(lang.equals("ger")){
				return Locale.GERMANY;
			} else if(lang.equals("ita")){
				return Locale.ITALY;
			} 
		}
		return null;
	}
	
	public static String getHtmlCurrencySymbol(Locale locale){
		String symbol = null;
		
		if(locale.equals(Locale.UK)) {
			symbol = "£";
		} else if(locale.equals(Locale.GERMANY)) {
			symbol = "€";
		} if(locale.equals(Locale.ITALY)) {
			symbol = "€";
		}
		
		return symbol;
	}
	
	public static String getHtmlCurrencySymbol(String currencySmybol){
		String symbol = null;
		
		if(currencySmybol.equals("GBP")) {
			symbol = "£";
		} 
		
		return symbol;
	}
}
